package hu.dynamicwebshop.entities;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Szecskó Zoltán <zoltan.szecsko@gmail.com>
 */
@Entity
@Table(name = "menu_contents")
public class MenuContent {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "menu_content_seq")
    @SequenceGenerator(name = "menu_content_seq", sequenceName = "menu_content_seq")
    @Column(name = "content_id", nullable = false)
    private int contentId;
    @OneToMany()
    @JoinColumn(name = "content_id", nullable = true)
    private List<Menu> menu = new ArrayList<Menu>();
    @Column(name = "content")
    private String content;

    public List<Menu> getMenu() {
        return menu;
    }

    public void setMenu(List<Menu> menu) {
        this.menu = menu;
    }

    public int getContentId() {
        return contentId;
    }

    public void setContentId(int contentId) {
        this.contentId = contentId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
